import Cookies from 'js-cookie'
 
const TokenKey = 'UT_token'
 
// 专门用来记录token开始时间的
const TimeKey = 'Token_time'
 
const TenantIdKey = 'TENANT_ID'
 
// 获取
export function getToken () {
  return Cookies.get(TokenKey)
}
// 设置
export function setToken (token) {
  // debugger
  return Cookies.set(TokenKey, token)
}
// 删除
export function removeToken () {
  return Cookies.remove(TokenKey)
}
 
// 获取token开始的时间
export function getTokenTime () {
  return Cookies.get(TimeKey)
}
 
// 设置token开始的时间
export function setTokenTime () {
  return Cookies.set(TimeKey, Date.now())
}
 
// 删除token开始的时间
export function removeTokenTime () {
  return Cookies.remove(TimeKey)
}
 
export function getTenantId () {
  return Cookies.get(TenantIdKey)
}
 
export function setTenantId (username) {
  return Cookies.set(TenantIdKey, username)
}
 
export function removeTenantId () {
  return Cookies.remove(TenantIdKey)
}